import { Event, eventQueue } from './EventQueue'
import { currentTime } from './SimulationClock'

type Action = () => void

export const schedule = (timeOffset: number, action: Action, description: string): void => {
  eventQueue.enqueue(new Event(currentTime + timeOffset, action, description))
}
